package com.icloud.common.database.enums;

import lombok.Getter;

@Getter
public enum TaskCodeEnum {
    REFUND_RED_PKT("REFUND_RED_PKT"),
    CAL_WITHDRAWABLE("CAL_WITHDRAWABLE"),
    AUTO_COLLECT("AUTO_COLLECT");

    private String code;

    TaskCodeEnum(String code){
        this.code = code;
    }

    public static TaskCodeEnum byCode(String code) {
        for (TaskCodeEnum e: TaskCodeEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
}
